package com.kuangjia.student_ems.exception;

import org.springframework.http.HttpStatus;

public class BusinessException extends RuntimeException {
    
    private final HttpStatus status;
    private final String message;
    
    public BusinessException(HttpStatus status, String message) {
        super(message);
        this.status = status;
        this.message = message;
    }
    
    public BusinessException(String message) {
        this(HttpStatus.BAD_REQUEST, message);
    }
    
    public HttpStatus getStatus() {
        return status;
    }
    
    @Override
    public String getMessage() {
        return message;
    }
} 